package com.jason.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.jason.entity.UserEntity;
import com.jason.service.user.UserService;
import com.jason.util.Page;

@Controller
@RequestMapping("/test")
public class TestController {
	@Autowired
	private UserService userService;
	
	private Page<UserEntity> userPage=new Page<UserEntity>();
	
	@RequestMapping(value = "/t")
	public ModelAndView helloWorld(HttpServletRequest request, HttpServletResponse response) {
		userService.getAll(userPage);
		request.setAttribute("userPage", userPage);
		return new ModelAndView("/helloWorld", "message",null);

	}

	public Page<UserEntity> getUserPage() {
		return userPage;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
}
